#! /usr/bin/env python
from pywslib import *
pyws = pywslib()
try:
	act = pyws.GET["act"]
except:
	act = 0
try:
	cookie = pyws.COOKIE["test"]
except:
	cookie = 0
	
if not act:
	pyws.header()
	if cookie == "1":
		print "Cookie Creato, <a href='cookie.py?act=cancella'>Cancellalo</a>"
	else:
		print "Cookie non creato, <a href='cookie.py?act=crea'>Crea</a>"
elif act == "cancella":
	pyws.setcookie("test","")
	pyws.header()
	print "<a href='cookie.py'>Fatto</a>"
elif act == "crea":
	pyws.setcookie("test","1")
	pyws.header()
	print "<a href='cookie.py'>Fatto</a>"
	
